﻿@{
    Layout = "~/Views/Shared/_Form.cshtml";
}
@model Raffles.OA.Data.Config 
<form class="form-horizontal m" role="form">
    <div class="form-group">
        <label class="col-sm-3 control-label">参数名称<font class="red">*</font></label>
        <div class="col-sm-9">
            @Html.TextBoxFor(model => model.Name, new { @class = "form-control required", @placeholder = "请输入参数名称"})
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">参数键名<font class="red">*</font></label>
        <div class="col-sm-9">
            @Html.TextBoxFor(model => model.Code, new { @class = "form-control required", @placeholder = "请输入参数键名"})
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">参数键值<font class="red">*</font></label>
        <div class="col-sm-9">
            @Html.TextBoxFor(model => model.Value, new { @class = "form-control required", @placeholder = "请输入参数键值"})
        </div>
    </div> 
    <div class="form-group">
        <label class="col-sm-3 control-label">参数描述</label>
        <div class="col-sm-9">
            @Html.TextAreaFor(model => model.Description, new { @class = "form-control", @placeholder = "请输入参数描述" })
        </div>
    </div>
</form>
<script type="text/javascript">

    function saveForm() { 
        if ($("form").validate().form()) {
            frame.ajax({
                url: '@Url.Content("/Manage/Config/SaveForm")',
                type: "post",
                data: $('form').formSerialize(),
                success: function (obj) {
                    if (obj.success) {
                        frame.msgSuccess(obj.message);
                        parent.searchGrid();
                        frame.closeDialog(); 
                    }
                    else {
                        frame.msgError(obj.message);
                    }
                }
            });
        }
    } 
</script>